package com.wakey.rtcs.web.service.impl;

import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.wakey.rtcs.web.mapper.FileMapper;
import com.wakey.rtcs.web.model.File;
import com.wakey.rtcs.web.service.FileService;

@Service
public class FileServiceImpl implements FileService{
	@Autowired
	FileMapper fileMapper;

	@Override
	public int saveFile(File file) {
		file.setCreateTime(new Date());
		return fileMapper.saveFile(file);
	}

	@Override
	public int deleteFile(Long id) {
		return fileMapper.deleteFile(id);
	}

	@Override
	public List<File> queryFileList(Long docId, Integer userType, Long userId) {
		return fileMapper.queryFileList(docId,userType,userId);
	}

	@Override
	public List<File> queryLastestFile(Long docId, Integer userType, Long userId) {
		return fileMapper.queryLastestFile(docId,userType,userId);
	}

	@Override
	public List<File> queryAllFile(File file) {
		return fileMapper.queryAllFile(file);
	}

	@Override
	public int checkFile(Long id, Integer check, String advice, Long checkMan) {
		return fileMapper.checkFile(id,check,advice,checkMan);
	}

}
